// 维修工单
import {
	request_post
} from '@/api/request.js'

import {
	getData
} from '@/tools/tools.js'

// 交货单列表 1
export const jiaohuoList = () => {
	return request_post(('/delivery_note_list'), {
		user_id:  getData().id
	})
}

// 交货单详情 1
export const jiaohuoMessage = (rec) => {
	return request_post(('/delivery_note_xiangqing'), {
		user_id:  getData().id,
		record_id: rec
	})
}

// 交货单图片列表 1
export const photoList = (rec) => {
	return request_post(('/delivery_note_xiangqing_photos'), {
		user_id: getData().id,
		record_id: rec
	})
}

// 交货单 查看作业列表  1
export const getZuoYeList = (rec) => {
	return request_post(('/delivery_note_xiangqing_zuoye'),{
		user_id: getData().id,
		record_id: rec
	})
}

// 跳转作业详情  x
export const getZuoyeXiangqing = (rec) => {
	return request_post(('/delivery_note_xiangqing_zuoye_xq'),{
		user_id: getData().id,
		record_id: rec
	})
}


// 交货单作业-跳转收货-生成序号  1
export const getZuoyeIndexShengcheng  = (rec) => {
	return request_post(('/delivery_note_xiangqing_zuoye_xq'),{
		user_id: getData().id,
		record_id: rec,
		next_serial:rec.start,
		next_serial_count:rec.end,
	})
}


// 交货单验证 1 
export const getCheckDataList = (rec) => {
	return request_post(('/delivery_note_button_validate'), {
		user_id:  getData().id,
		record_id: rec,
	})
}



// 交货产品信息
export const getJiaohuoChanpinMessage = (rec) => {
	return request_post(('/delivery_note_action_show_details'), {
		user_id:  getData().id,
		record_id: rec
	})
}

// 跳转 lable-line
export const getJiaohuoLineId = (rec) => {
	return request_post(('/delivery_note_action_show_details_xq'),{
		user_id:  getData().id,
		record_id: rec
	})
}

// 获取 lable - list = 

export const getLabeList = (rec) => {
	return request_post(('/delivery_note_get_serail'),{
		user_id:  getData().id,
		record_id: rec
	})
}

// 保存
export const labelSaveBtn = (from) => {
	return request_post(('/delivery_note_action_upload'),{
		user_id:  getData().id,
		record_id: from.record_id,
		lot_id:from.id,
		qty_done:from.qty_done
	})
}

// 交货单详情 获取物流公司ID和名称
export const getWuliuList = () => {
	return request_post(('/jiaohuodan_get_company'),{
		user_id:  getData().id
	})
}
// 修改交货单
export const xiuGaiJiaoHuoDan = (data) => {
	return request_post(('/jiaohuodan_get_company_change'),{
		user_id:  getData().id,
		record_id: data.recid,
		wuliu_company: data.wuliuid,
		fukuan_way:data.fukuan,
		zhuizong_cankao:data.cankao,
		carrier_id:data.wuliu2id
	})
}